package string;

public class StringDemo {
    public static void main(String[] args) {
        String s1 = "123abc";
        String s2 = "123abc";
        String s3 = "123abc";
        String s4 = new String("123abc");
        System.out.println(s1==s2);
        System.out.println(s1==s3);
        System.out.println(s1==s4);


        String s="123";
        String s5=s+"abc";
        System.out.println(s5==s1);
        String s6="123"+"abc";
        System.out.println(s6==s1);
        System.out.println(s1.equals(s2));
        System.out.println(s1.equals(s3));
        System.out.println(s1.equals(s4));
        System.out.println(s1.equals(s5));


    }
}
